package com.sch.www.feign.factory;


import com.sch.www.feign.UserApi;
import com.sch.www.feign.fallback.UserApiFallbackImpl;
import feign.hystrix.FallbackFactory;

/**
 * 用户断路器工厂
 *
 * @author tangyi
 * @date 2019/3/23 23:38
 */

public class UserServiceClientFallbackFactory implements FallbackFactory<UserApi> {

    public UserServiceClientFallbackFactory() {

    }

    @Override
    public UserApi create(Throwable throwable) {
        UserApiFallbackImpl userServiceClientFallback = new UserApiFallbackImpl();
        userServiceClientFallback.setThrowable(throwable);
        return userServiceClientFallback;
    }
}
